rem
	bbdoc: All in-game mobs
end rem
Type TMob Extends TActor
	Function Create:TMob(code, x, y)
		Local d:TMob = New TMob
		
		d.x = x
		d.y = y
		
		d.dmg = 3
		d.health = 5
		d.code = code
		
		actorList.AddLast(d)
		Return d
	End Function
	
	Method Update()
		Local relx, rely
		Draw()
		If turn=1 Then 
			relx = 0; rely = 0
			If player.x > x Then relx = 1
			If player.x < x Then relx = -1
			If player.y > y Then rely = 1
			If player.y < y Then rely = -1
			
			Move(relx, rely)
			If health <= 0 Then actorList.Remove(Self)
		EndIf
	End Method
	
	Method Attack(Handle:TActor)
		Handle.health:-Self.dmg
		If Handle=player Then console.consoleAdd(Chr(code)+" bites you for "+Self.dmg+" health.")
	End Method
End Type
